package file;

import java.io.File;
import java.io.FileFilter;

public class Test3 {
    public static void main(String[] args) {
        File file = new File(".");
        if(file.isDirectory()){
           /* FileFilter filter = new FileFilter() {
                @Override
                public boolean accept(File pathname) {
                    return pathname.getName().contains("a");
//                    return pathname.getName().indexOf('a')>=0;
                }
            };*/
            File[] dirs = file.listFiles(f -> f.getName().contains("a"));
            for (File fil : dirs){
                System.out.println(fil.getName());
            }
            System.out.println(dirs.length);
        }
    }
}
